package com.sh.fmbackend.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.sh.fmbackend.model.domain.Team;
import com.sh.fmbackend.model.domain.User;
import com.sh.fmbackend.model.dto.TeamQuery;
import com.sh.fmbackend.model.request.TeamAddRequest;
import com.sh.fmbackend.model.request.TeamJoinRequest;
import com.sh.fmbackend.model.request.TeamQuitRequest;
import com.sh.fmbackend.model.request.TeamUpdateRequest;
import com.sh.fmbackend.model.vo.TeamUserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 舒云
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-12-30 21:20:57
*/
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     * @param team
     * @return
     */
    long addTeam(Team team, User loginUser);


    /**
     * 查询队伍
     * @param teamQuery
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     *  @param loginUser  登录用户
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @return
     */
    Boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 删除队伍
     * @param teamId
     * @param loginUser
     * @return
     */
    boolean delTeam(long teamId, User loginUser);



    List<TeamUserVO> listTeamsStrong(TeamQuery teamQuery, HttpServletRequest request);
}
